package demo.practice.competition;

public class P5830 {

    public static void main(String[] args) {
        P5830 p5830 = new P5830();
        p5830.isThree(4);
    }

    public boolean isThree(int n) {

        if (n == 1 || n == 2) {
            return false;
        }


        int count = 0;
        for (int i = 2; i < n; i++) {
            int c = n / i;
            if (n % i == 0) {
                if (c == i) {
                    count++;
                    if (count > 1) {
                        return false;
                    }
                } else {
                    return false;
                }

            }
        }

        return count == 1;

    }
}
